package com.zx.idc.backend.gui.scheduler.mo.moIllegalInfo;

import com.zx.idc.ds.mo.service.IMoIllegalInfoService;
import com.zx.idc.ds.sys.entity.SysConfiguration;
import com.zx.idc.ds.sys.service.ISysConfigurationService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 非法日志定时任务实现类
 */
public class MoIllegalInfoScheduledJob implements Job {

    @Autowired
    private IMoIllegalInfoService iMoIllegalInfoService;

    @Autowired
    private ISysConfigurationService iSysConfigurationService;


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        SysConfiguration sysConfiguration=iSysConfigurationService.selectOne(new SysConfiguration().setConfigKey("sysSettings_retain_illegal_day"));
        Integer configValue=Integer.parseInt(sysConfiguration.getConfigValue());
        if (configValue>0) {
            iMoIllegalInfoService.deleteByLastFoundTime(Integer.parseInt(sysConfiguration.getConfigValue()));
        }
    }
}
